<!--
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/order/ingredientlist/IngredientListElement.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/order/ingredientlist/IngredientListElement.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Id',
                footer: "Foots",
                cnName: '配料单明细-元素',
                name: 'ingredientlist/IngredientListElement',
                url: "/IngredientListElement/",
                sortName: "IngredientListId",
                foreignKey:null
            });
            const editFormFields = ref({"IngredientListId":"","IngredientListDetailsId":"","MaterialName":"","BatchNumber":"","Identifying":"","ElementName":"","TargetProportion":"","ActualProportion":"","TargetWeight":"","ActualWeight":""});
            const editFormOptions = ref([[{"title":"配料单号ID","field":"IngredientListId"},
                               {"title":"配料明细ID","field":"IngredientListDetailsId"},
                               {"title":"物料名称","field":"MaterialName"}],
                              [{"title":"批次号","field":"BatchNumber"},
                               {"title":"标识","field":"Identifying","type":"number"},
                               {"title":"元素名称","field":"ElementName"}],
                              [{"title":"目标比例","field":"TargetProportion","type":"decimal"},
                               {"title":"实际比例","field":"ActualProportion","type":"decimal"},
                               {"title":"目标重量","field":"TargetWeight","type":"decimal"}],
                              [{"title":"实际重量","field":"ActualWeight","type":"decimal"}]]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([{field:'Id',title:'主键',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'IngredientListId',title:'配料单号ID',type:'string',width:110,hidden:true,align:'left'},
                       {field:'IngredientListDetailsId',title:'配料明细ID',type:'string',width:110,hidden:true,align:'left'},
                       {field:'MaterialName',title:'物料名称',type:'string',width:110,align:'left',sort:true},
                       {field:'BatchNumber',title:'批次号',type:'string',width:110,align:'left'},
                       {field:'Identifying',title:'标识',type:'int',width:110,align:'left'},
                       {field:'ElementName',title:'元素名称',type:'string',width:110,align:'left'},
                       {field:'TargetProportion',title:'目标比例',type:'decimal',width:110,align:'left'},
                       {field:'ActualProportion',title:'实际比例',type:'decimal',width:110,align:'left'},
                       {field:'TargetWeight',title:'目标重量',type:'decimal',width:110,align:'left'},
                       {field:'ActualWeight',title:'实际重量',type:'decimal',width:110,align:'left'},
                       {field:'MaterialId',title:'物料ID',type:'string',width:110,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
